package com.aspose.cells;

import java.util.ArrayList;

class zatm {
   private static float c = com.aspose.cells.a.d.zfq.a();
   static com.aspose.cells.b.a.g.a.ze a = new com.aspose.cells.b.a.g.a.ze("[-+]?(\\d+([\\.\\,]\\d*)?|[\\.\\,]\\d+)([eE]([-+]?([012]?\\d{1,2}|30[0-7])|-3([01]?[4-9]|[012]?[0-3])))?[dD]?[\\s]*");
   static com.aspose.cells.b.a.g.a.ze b = new com.aspose.cells.b.a.g.a.ze("[\\d,\\.]+");

   static int a(int var0) {
      switch(var0) {
      case 2:
         return 12;
      case 3:
         return 14;
      case 4:
         return 9;
      case 5:
         return 29;
      case 6:
         return 28;
      case 7:
         return 20;
      case 8:
         return 21;
      case 9:
         return 49;
      case 10:
         return 46;
      case 11:
         return 25;
      case 12:
         return 24;
      case 13:
         return 18;
      case 14:
         return 19;
      case 15:
         return 48;
      case 16:
         return 10;
      case 17:
         return 8;
      case 18:
         return 7;
      default:
         return 0;
      }
   }

   static boolean a(zbgq var0, zfu var1, int var2) throws Exception {
      if (var2 != var0.j().M().getIndex()) {
         return false;
      } else if (var0.c() <= var0.d() && var0.e() <= var0.f()) {
         if (var0.j().isHidden()) {
            return false;
         } else if (!(var0.j() instanceof ChartShape) && var0.j().W().h() * var0.j().W().i() == 0.0F) {
            return false;
         } else {
            if (var0.j() instanceof ChartShape) {
               ChartShape var3 = (ChartShape)((ChartShape)var0.j());
               if (var3.getChart().getChartObject().getWidth() * var3.getChart().getChartObject().getHeight() == 0) {
                  return false;
               }
            }

            com.aspose.cells.b.a.b.zp var5 = new com.aspose.cells.b.a.b.zp(var0.e(), var0.c(), var0.f() - var0.e() + 1, var0.d() - var0.c() + 1);
            com.aspose.cells.b.a.b.zp var4 = new com.aspose.cells.b.a.b.zp(var1.b, var1.a, var1.d - var1.b + 1, var1.c - var1.a + 1);
            return var5.a(var4);
         }
      } else {
         return false;
      }
   }

   static String a(int var0, char var1, Font var2) throws Exception {
      StringBuilder var3 = new StringBuilder();
      int var4 = a(Character.toString(var1), var2, 1.0D);
      int var5 = var0 / var4;

      for(int var6 = 0; var6 < var5; ++var6) {
         var3.append(var1);
      }

      return com.aspose.cells.b.a.zr.a(var3);
   }

   static int a(Font var0) throws Exception {
      com.aspose.cells.b.a.b.zs var1 = com.aspose.cells.a.d.zfq.a(var0.getName(), (float)var0.getDoubleSize(), "|", var0.m());
      return var1.c();
   }

   static double[] a(Worksheet var0) {
      Font var1 = var0.getWorkbook().getWorksheets().G();
      double var2 = 1.0D;
      double var4 = 1.0D;
      if ("Times New Roman".equals(var1.getName())) {
         switch(var1.getSize()) {
         case 10:
            var2 = 1.1186943620178043D;
            var4 = 1.0214285714285714D;
            break;
         case 11:
            var2 = 1.0505836575875487D;
            var4 = 0.940809968847352D;
            break;
         case 12:
            var2 = 1.0103703703703704D;
            var4 = 0.9439024390243902D;
         }
      } else if ("Calibri".equals(var1.getName()) && var1.getSize() == 10) {
         switch(var0.getPageSetup().getPrintQuality()) {
         case 96:
            var2 = 1.001543209876543D;
            var4 = 0.9422492401215805D;
            break;
         case 100:
            var2 = 0.9600591715976331D;
            var4 = 1.0163934426229508D;
            break;
         case 120:
            var2 = 1.0268987341772151D;
            var4 = 1.0356347438752784D;
            break;
         case 200:
            var2 = 0.9600591715976331D;
            var4 = 1.0449438202247192D;
            break;
         case 600:
            var2 = 0.9614814814814815D;
            var4 = 1.0276243093922652D;
            break;
         default:
            var2 = 0.9614814814814815D;
            var4 = 1.0367892976588629D;
         }
      } else if ("Calibri".equals(var1.getName()) && var1.getSize() == 12) {
         var2 = 1.0D;
         var4 = 1.0238095238095237D;
      } else if ("Calibri".equals(var1.getName()) && var1.getSize() == 11) {
         switch(var0.getPageSetup().getPrintQuality()) {
         case 96:
            var2 = 1.001543209876543D;
            var4 = 0.950920245398773D;
            break;
         case 100:
            var2 = 0.9600591715976331D;
            var4 = 0.9126594700686947D;
            break;
         case 120:
            var2 = 1.0268987341772151D;
            var4 = 0.9198813056379822D;
            break;
         case 200:
            var2 = 1.0962837837837838D;
            var4 = 0.9607438016528925D;
            break;
         case 600:
            var2 = 1.0759036144578313D;
            var4 = 0.9661764705882353D;
            break;
         default:
            var2 = 1.0518638573743921D;
            var4 = 0.9607438016528925D;
         }
      } else if ("ＭＳ Ｐゴシック".equals(var1.getName())) {
         var2 = 0.9212962962962963D;
         var4 = 0.9058380414312618D;
      } else if (var1.getName().startsWith("ＭＳ") && var1.getSize() == 9) {
         switch(var0.getPageSetup().getPrintQuality()) {
         case 96:
            var2 = 1.001543209876543D;
            var4 = 1.0010764262648009D;
            break;
         case 100:
            var2 = 1.1151202749140894D;
            var4 = 1.024229074889868D;
            break;
         case 120:
            var2 = 1.0709570957095709D;
            var4 = 0.9597523219814241D;
            break;
         case 200:
            var2 = 1.0384D;
            var4 = 0.9281437125748503D;
            break;
         case 600:
            var2 = 1.0156494522691706D;
            var4 = 0.908203125D;
            break;
         default:
            var2 = 1.0140625D;
            var4 = 0.9393939393939394D;
         }
      } else if (var1.getName().startsWith("ＭＳ") && var1.getSize() == 10) {
         switch(var0.getPageSetup().getPrintQuality()) {
         case 96:
            var2 = 1.001543209876543D;
            var4 = 1.0010764262648009D;
            break;
         case 100:
            var2 = 0.9600591715976331D;
            var4 = 1.0208562019758507D;
            break;
         case 120:
            var2 = 1.0268987341772151D;
            var4 = 1.0D;
            break;
         case 200:
            var2 = 0.9600591715976331D;
            var4 = 0.9607438016528925D;
            break;
         case 600:
            var2 = 0.9614814814814815D;
            var4 = 0.9309309309309309D;
            break;
         default:
            var2 = 0.9614814814814815D;
            var4 = 0.9607438016528925D;
         }
      } else if (var1.getName().startsWith("ＭＳ") && var1.getSize() == 11) {
         switch(var0.getPageSetup().getPrintQuality()) {
         case 96:
            var2 = 1.001543209876543D;
            var4 = 1.0010764262648009D;
            break;
         case 100:
            var2 = 0.9600591715976331D;
            var4 = 0.9607438016528925D;
            break;
         case 120:
            var2 = 0.9001386962552012D;
            var4 = 0.9337349397590361D;
            break;
         case 200:
            var2 = 0.9600591715976331D;
            var4 = 0.9337349397590361D;
            break;
         case 600:
            var2 = 0.9118942731277533D;
            var4 = 0.90625D;
            break;
         default:
            var2 = 0.921875D;
            var4 = 0.9253731343283582D;
         }
      } else if (var1.getName().startsWith("ＭＳ") && var1.getSize() == 12) {
         switch(var0.getPageSetup().getPrintQuality()) {
         case 96:
            var2 = 1.001543209876543D;
            var4 = 1.0010764262648009D;
            break;
         case 100:
            var2 = 1.0798668885191347D;
            var4 = 1.0108695652173914D;
            break;
         case 120:
            var2 = 1.0D;
            var4 = 0.96875D;
            break;
         case 200:
            var2 = 1.020440251572327D;
            var4 = 0.9346733668341709D;
            break;
         case 600:
            var2 = 1.001543209876543D;
            var4 = 0.9272183449651047D;
            break;
         default:
            var2 = 1.001543209876543D;
            var4 = 0.9441624365482234D;
         }
      } else if ("Arial".equals(var1.getName()) && var1.getSize() == 9) {
         switch(var0.getPageSetup().getPrintQuality()) {
         case 96:
            var2 = 1.001543209876543D;
            var4 = 1.0010764262648009D;
            break;
         case 100:
            var2 = 0.9600591715976331D;
            var4 = 1.0208562019758507D;
            break;
         case 120:
            var2 = 0.9127988748241913D;
            var4 = 0.9002904162633107D;
            break;
         case 200:
            var2 = 0.9600591715976331D;
            var4 = 0.93D;
            break;
         case 600:
            var2 = 0.9481481481481482D;
            var4 = 0.9309309309309309D;
            break;
         default:
            var2 = 0.9614814814814815D;
            var4 = 0.9607438016528925D;
         }
      } else if ("Arial".equals(var1.getName()) && var1.getSize() == 10) {
         var2 = 1.0521920668058455D;
         var4 = 0.9710867397806581D;
      } else if ("Arial".equals(var1.getName()) && var1.getSize() == 11) {
         switch(var0.getPageSetup().getPrintQuality()) {
         case 96:
            var2 = 1.001543209876543D;
            var4 = 0.9480122324159022D;
            break;
         case 100:
            var2 = 0.9600591715976331D;
            var4 = 0.9099804305283757D;
            break;
         case 120:
            var2 = 1.0D;
            var4 = 0.96875D;
            break;
         case 200:
            var2 = 1.020440251572327D;
            var4 = 0.9607438016528925D;
            break;
         case 600:
            var2 = 1.020440251572327D;
            var4 = 0.9617373319544984D;
            break;
         default:
            var2 = 1.0417335473515248D;
            var4 = 0.9779179810725552D;
         }
      } else if ("Arial".equals(var1.getName()) && var1.getSize() == 8) {
         var2 = 0.9866369962692261D;
         var4 = 0.90625D;
      } else if ("Geneva".equals(var1.getName()) && var1.getSize() == 9) {
         var2 = 1.0807600950118765D;
         var4 = 1.0551470588235294D;
      } else if ("Verdana".equals(var1.getName()) && var1.getSize() == 10) {
         var2 = 1.055363321799308D;
         var4 = 1.013840830449827D;
      } else if ("Verdana".equals(var1.getName()) && var1.getSize() == 8) {
         var2 = 0.9607201309328969D;
         var4 = 0.9396551724137931D;
      } else if ("Arial MT".equals(var1.getName()) && var1.getSize() == 12) {
         var2 = 0.995850622406639D;
         var4 = 0.983402489626556D;
      } else if ("Tahoma".equals(var1.getName()) && var1.getSize() == 10) {
         var2 = 1.0260416666666667D;
         var4 = 1.0D;
      } else if ("MS Sans Serif".equals(var1.getName()) && var1.getSize() == 8) {
         var2 = 0.9006410256410257D;
         var4 = 0.9548387096774194D;
      } else if ("Geneva".equals(var1.getName())) {
         var2 = 1.051948051948052D;
         var4 = 0.9682926829268292D;
      } else if ("宋体".equals(var1.getName())) {
         var2 = 0.9212962962962963D;
         var4 = 1.0041152263374487D;
      } else if ("돋움".equals(var1.getName()) && var1.getSize() == 11) {
         var2 = 0.8619102416570771D;
         var4 = 0.9989327641408752D;
      } else if ("Microsoft YaHei".equals(var1.getName()) && var1.getSize() == 9) {
         var2 = 1.0058910162002945D;
         var4 = 0.916015625D;
      } else if ("Comic Sans MS".equals(var1.getName()) && var1.getSize() == 10) {
         var2 = 1.0208333333333333D;
         var4 = 1.0644444444444445D;
      } else if ("Arial Narrow".equals(var1.getName())) {
         var2 = 0.959375D;
         var4 = 0.8426573426573427D;
      } else if ("Calisto MT".equals(var1.getName())) {
         var2 = 0.959375D;
         var4 = 0.9776876267748479D;
      } else if ("Trebuchet MS".equals(var1.getName())) {
         var2 = 1.0046875D;
         var4 = 0.9037037037037037D;
      } else if ("Rockwell".equals(var1.getName())) {
         var2 = 0.9984567901234568D;
         var4 = 0.9339712918660287D;
      } else if (!"맑은 고딕".equals(var1.getName()) && !"Malgun Gothic".equals(var1.getName())) {
         switch(var0.getPageSetup().getPrintQuality()) {
         case 96:
            var2 = 1.001543209876543D;
            var4 = 1.0010764262648009D;
            break;
         case 100:
            var2 = 1.0944350758853287D;
            var4 = 0.9607438016528925D;
            break;
         case 120:
            var2 = 1.0268987341772151D;
            var4 = 0.9883103081827843D;
            break;
         case 200:
            var2 = 1.0962837837837838D;
            var4 = 0.9883103081827843D;
            break;
         case 600:
            var2 = 1.0535714285714286D;
            var4 = 0.9707724425887265D;
            break;
         default:
            var2 = 1.0518638573743921D;
            var4 = 0.9799789251844047D;
         }
      } else {
         var2 = 1.0208333333333333D;
         var4 = 1.0126849894291754D;
      }

      return new double[]{var2, var4};
   }

   static double[] a(Worksheet var0, double var1, double var3, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12) {
      Cells var13 = var0.getCells();
      double[] var14 = new double[]{1.0D, 1.0D};
      PageSetup var15 = var0.getPageSetup();
      double[] var16 = a(var0);
      double var17 = 0.0D;
      double var19 = 0.0D;
      double var21;
      if (!var15.isPercentScale() && (var15.getFitToPagesTall() != 0 || var15.getFitToPagesWide() != 0)) {
         var14[0] = var16[0];
         var14[1] = var16[1];
         int var25;
         if (var15.getFitToPagesWide() != 0) {
            for(var25 = var11; var25 <= var12 && var25 >= 0; ++var25) {
               var17 += var13.c.b(var25) * 72.0D;
            }

            var14[0] = a(var0, var13.c, var1, var5, var6, var17);
            if (var14[0] > var16[0]) {
               var14[0] = var16[0];
            }

            if (var14[0] < 0.1D) {
               var14[0] = 0.1D;
            }
         }

         if (var15.getFitToPagesTall() != 0) {
            for(var25 = var9; var25 <= var10 && var25 >= 0; ++var25) {
               var19 += var13.getRowHeightInch(var25) * 72.0D;
            }

            var14[1] = a(var0, var3, var7, var8, var19);
            if (var14[1] > var16[1]) {
               var14[1] = var16[1];
            }

            if (var14[1] < 0.1D) {
               var14[1] = 0.1D;
            }
         }

         if (var15.getFitToPagesTall() == 0 && var15.getFitToPagesWide() == 0) {
            var14[0] = var16[0];
            var14[1] = var16[1];
         } else {
            var21 = Math.min(var14[0], var14[1]);
            if (var21 > Math.min(var16[0], var16[1])) {
               var14[0] = var16[0];
               var14[1] = var16[1];
            } else if (var21 > 1.0D) {
               var14 = var16;
            } else {
               double var23 = var16[0] / var16[1] * var14[1];
               if (var23 > var14[0]) {
                  var14[1] = var16[1] / var16[0] * var14[0];
               } else {
                  var14[0] = var23;
               }
            }

            float var26 = (float)Math.min(var14[0] / var16[0], var14[1] / var16[1]);
            var26 = (float)((int)(var26 * 100.0F)) / 100.0F;
            var14[0] = var16[0] * (double)var26;
            var14[1] = var16[1] * (double)var26;
            if (var14[0] < 0.1D) {
               var14[0] = 0.1D;
            }

            if (var14[1] < 0.1D) {
               var14[1] = 0.1D;
            }
         }

         return var14;
      } else {
         var21 = (double)var15.getZoom() / 100.0D;
         var14 = new double[]{var21, var21};
         var14[0] *= var16[0];
         var14[1] *= var16[1];
         return var14;
      }
   }

   static double a(Worksheet var0, zagg var1, double var2, int var4, int var5, double var6) {
      double var8 = 0.0D;
      double var10 = 0.0D;
      Cells var12 = var0.getCells();
      PageSetup var13 = var0.getPageSetup();
      if (!var13.isPercentScale()) {
         for(int var14 = var4; var14 <= var5; ++var14) {
            var10 += var1.b(var14) * 72.0D;
         }

         var10 += var6 * (double)(var13.getFitToPagesWide() - 1);
         if (var10 != 0.0D) {
            var8 = (double)var13.getFitToPagesWide() * var2 / var10;
         }
      }

      return var8;
   }

   static double a(Worksheet var0, double var1, int var3, int var4, double var5) {
      double var7 = 0.0D;
      double var9 = 0.0D;
      Cells var11 = var0.getCells();
      PageSetup var12 = var0.getPageSetup();
      if (!var12.isPercentScale()) {
         for(int var13 = var3; var13 <= var4; ++var13) {
            var9 += var11.getRowHeightInch(var13) * 72.0D;
         }

         var9 += var5 * (double)(var12.getFitToPagesTall() - 1);
         if (var9 != 0.0D) {
            var7 = (double)var12.getFitToPagesTall() * var1 / var9;
         }
      }

      return var7;
   }

   static void a(Worksheet var0, double[] var1, double[] var2, double var3, double var5) {
      PageSetup var7 = var0.getPageSetup();
      var1[0] = (var3 - (var7.getLeftMarginInch() + var7.getRightMarginInch())) * 72.0D;
      var2[0] = (var5 - (var7.getTopMarginInch() + var7.getBottomMarginInch())) * 72.0D;
   }

   static void a(PageSetup var0, double[] var1, double[] var2) {
      var1[0] = com.aspose.cells.b.a.zq.b(8.267716535433072D, 2);
      var2[0] = com.aspose.cells.b.a.zq.b(16.535433070866144D, 2);
      int var5 = var0.getPaperSize();
      double var3;
      switch(var5) {
      case 1:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 11.0D;
         break;
      case 2:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 11.0D;
         break;
      case 3:
         var1[0] = 11.0D;
         var2[0] = 17.0D;
         break;
      case 4:
         var1[0] = 17.0D;
         var2[0] = 11.0D;
         break;
      case 5:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 14.0D;
         break;
      case 6:
         var1[0] = 5.5D;
         var2[0] = 8.5D;
         break;
      case 7:
         var3 = 7.25D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var3 = 10.5D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 8:
         var1[0] = com.aspose.cells.b.a.zq.b(11.692913385826772D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(16.535433070866144D, 2);
         break;
      case 9:
         var1[0] = com.aspose.cells.b.a.zq.b(8.267716535433072D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(11.692913385826772D, 2);
         break;
      case 10:
         var1[0] = com.aspose.cells.b.a.zq.b(8.267716535433072D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(11.692913385826772D, 2);
         break;
      case 11:
         var1[0] = com.aspose.cells.b.a.zq.b(5.826771653543307D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(8.267716535433072D, 2);
         break;
      case 12:
         var1[0] = com.aspose.cells.b.a.zq.b(10.118110236220472D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(14.330708661417324D, 2);
         break;
      case 13:
         var1[0] = com.aspose.cells.b.a.zq.b(7.165354330708662D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(10.118110236220472D, 2);
         break;
      case 14:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 13.0D;
         break;
      case 15:
         var1[0] = com.aspose.cells.b.a.zq.b(8.46456692913386D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(10.826771653543307D, 2);
         break;
      case 16:
         var1[0] = 10.0D;
         var2[0] = 14.0D;
         break;
      case 17:
         var1[0] = 11.0D;
         var2[0] = 17.0D;
         break;
      case 18:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 11.0D;
         break;
      case 19:
         var3 = 3.875D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var3 = 8.875D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 20:
         var3 = 4.125D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var3 = 9.5D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 21:
         var3 = 4.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var3 = 10.375D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 22:
         var3 = 4.75D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 11.0D;
         break;
      case 23:
         var1[0] = 5.0D;
         var3 = 11.5D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 24:
         var1[0] = com.aspose.cells.b.a.zq.b(17.0D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(22.0D, 2);
         break;
      case 25:
         var1[0] = com.aspose.cells.b.a.zq.b(22.0D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(34.0D, 2);
         break;
      case 26:
         var1[0] = com.aspose.cells.b.a.zq.b(34.0D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(44.0D, 2);
         break;
      case 27:
         var1[0] = com.aspose.cells.b.a.zq.b(4.330708661417323D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(8.661417322834646D, 2);
         break;
      case 28:
         var1[0] = com.aspose.cells.b.a.zq.b(6.377952755905512D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(9.015748031496063D, 2);
         break;
      case 29:
         var1[0] = com.aspose.cells.b.a.zq.b(12.755905511811024D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(18.031496062992126D, 2);
         break;
      case 30:
         var1[0] = com.aspose.cells.b.a.zq.b(9.015748031496063D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(12.755905511811024D, 2);
         break;
      case 31:
         var1[0] = com.aspose.cells.b.a.zq.b(4.488188976377953D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(6.377952755905512D, 2);
         break;
      case 32:
         var1[0] = com.aspose.cells.b.a.zq.b(4.488188976377953D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(9.015748031496063D, 2);
         break;
      case 33:
         var1[0] = com.aspose.cells.b.a.zq.b(9.84251968503937D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(13.89763779527559D, 2);
         break;
      case 34:
         var1[0] = com.aspose.cells.b.a.zq.b(6.929133858267717D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(9.84251968503937D, 2);
         break;
      case 35:
         var1[0] = com.aspose.cells.b.a.zq.b(6.929133858267717D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(4.921259842519685D, 2);
         break;
      case 36:
         var1[0] = com.aspose.cells.b.a.zq.b(4.330708661417323D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(9.05511811023622D, 2);
         break;
      case 37:
         var3 = 3.875D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var3 = 7.5D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 38:
         var3 = 3.625D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var3 = 6.5D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 39:
         var3 = 14.875D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 11.0D;
         break;
      case 40:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 12.0D;
         break;
      case 41:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 13.0D;
         break;
      case 66:
         var1[0] = com.aspose.cells.b.a.zq.b(16.535433070866144D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(23.385826771653544D, 2);
         break;
      case 70:
         var1[0] = com.aspose.cells.b.a.zq.b(4.133858267716536D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(5.826771653543307D, 2);
         break;
      case 75:
         var3 = 8.5D;
         var1[0] = 11.0D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 300:
         var1[0] = 13.9D;
         var2[0] = 19.7D;
         break;
      case 301:
         var1[0] = com.aspose.cells.b.a.zq.b(3.5433070866141736D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(2.1653543307086616D, 2);
         break;
      default:
         var1[0] = com.aspose.cells.b.a.zq.b(8.267716535433072D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(11.692913385826772D, 2);
      }

      if (var0.getOrientation() == 0) {
         double var6 = var1[0];
         var1[0] = var2[0];
         var2[0] = var6;
      }

   }

   static boolean a(Style var0, Style var1) {
      if (var0 == null) {
         return false;
      } else if (var0.getForegroundColor().toArgb() == var1.getForegroundColor().toArgb() && var0.getPattern() == 0) {
         if (var0.d() == null) {
            return false;
         } else {
            return var0.getBorders().getByBorderType(4).getLineStyle() != 0 || var0.getBorders().getByBorderType(8).getLineStyle() != 0 || var0.getBorders().getByBorderType(1).getLineStyle() != 0 || var0.getBorders().getByBorderType(2).getLineStyle() != 0;
         }
      } else {
         return true;
      }
   }

   static ArrayList b(Worksheet var0) {
      Range[] var1 = var0.getPageSetup().b(false);
      if (var1 == null) {
         return null;
      } else {
         ArrayList var2 = new ArrayList();
         WorkbookSettings var3 = var0.c().n().getSettings();
         int var4 = var3.k();
         int var5 = var3.l();

         for(int var6 = 0; var6 < var1.length; ++var6) {
            CellArea var7 = var1[var6].a();
            if (var7.a(var5)) {
               var7.StartColumn = var7.EndColumn = -1;
            } else if (var7.b(var4)) {
               var7.StartRow = var7.EndRow = -1;
            }

            com.aspose.cells.b.a.a.ze.a(var2, (Object)var7);
         }

         return var2;
      }
   }

   static int a(zagg var0, int var1, double var2, double var4, boolean var6) {
      double var7 = var0.b(var1) * 72.0D * var4;
      if (var7 > var2) {
         return var1;
      } else {
         var2 -= var7;
         ++var1;

         do {
            var7 = var0.b(var1) * 72.0D * var4;
            var2 -= var7;
            if (var2 <= 0.0D) {
               break;
            }

            ++var1;
         } while(var1 != 255);

         if (var2 < 0.0D && var6) {
            --var1;
         }

         return var1;
      }
   }

   static int a(Worksheet var0, ArrayList var1) {
      return 0;
   }

   static int b(Worksheet var0, ArrayList var1) {
      return 0;
   }

   static int a(String var0, Font var1, double var2, int var4) throws Exception {
      zot var5 = new zot();
      var5.a = var0;
      var5.b = var1;
      float var6 = Math.max(0.1F, (float)(var5.b.getDoubleSize() * var2));
      int var7 = (var5.b.isBold() ? 1 : 0) | (var5.b.isItalic() ? 2 : 0) | (var5.b.isStrikeout() ? 8 : 0) | (var5.b.getUnderline() != 0 ? 4 : 0);
      com.aspose.cells.a.d.zav var8 = com.aspose.cells.a.d.zav.a(var5.b.getName(), var6, var7);
      com.aspose.cells.a.d.zf var9 = new com.aspose.cells.a.d.zf(var8, Color.getBlack(), new com.aspose.cells.b.a.b.zo(0.0F, 0.0F), var5.a, var5.b.isSuperscript(), var5.b.isSubscript());
      return Math.abs(var4) == 90 ? (int)((double)(var9.i().c() / 72.0F * c) * var2 + 0.9990000128746033D) : (int)((double)(var9.i().b() / 72.0F * c) * var2 + 0.9990000128746033D);
   }

   static double b(String var0, Font var1, double var2, int var4) throws Exception {
      zot var5 = new zot();
      var5.a = var0;
      var5.b = var1;
      float var6 = Math.max(0.1F, (float)(var5.b.getDoubleSize() * var2));
      int var7 = var1.m();
      com.aspose.cells.a.d.zav var8 = com.aspose.cells.a.d.zav.a(var5.b.getName(), var6, var7);
      com.aspose.cells.a.d.zf var9 = new com.aspose.cells.a.d.zf(var8, Color.getBlack(), new com.aspose.cells.b.a.b.zo(0.0F, 0.0F), var5.a, var5.b.isSuperscript(), var5.b.isSubscript());
      return Math.abs(var4) == 90 ? (double)var9.j().c() : (double)var9.j().b();
   }

   static int a(String var0, Font var1, double var2) throws Exception {
      zot var4 = new zot();
      var4.a = var0;
      var4.b = var1;
      float var5 = Math.max(0.1F, (float)(var4.b.getDoubleSize() * var2));
      int var6 = var1.m();
      com.aspose.cells.a.d.zav var7 = com.aspose.cells.a.d.zav.a(var4.b.getName(), var5, var6);
      com.aspose.cells.a.d.zf var8 = new com.aspose.cells.a.d.zf(var7, Color.getBlack(), new com.aspose.cells.b.a.b.zo(0.0F, 0.0F), var4.a, var4.b.isSuperscript(), var4.b.isSubscript());
      return (int)((double)(var8.i().b() / 72.0F * c) * var2 + 0.5D) + 1;
   }

   static int b(String var0, Font var1, double var2) throws Exception {
      zot var4 = new zot();
      var4.a = var0;
      var4.b = var1;
      float var5 = Math.max(0.1F, zgd.a(var1.getDoubleSize(), (float)var2));
      if (var1.isSubscript() || var1.isSuperscript()) {
         var5 *= zgd.b;
      }

      int var6 = var1.m();
      com.aspose.cells.a.d.zav var7 = com.aspose.cells.a.d.zav.a(var4.b.getName(), var5, var6);
      com.aspose.cells.a.d.zf var8 = new com.aspose.cells.a.d.zf(var7, Color.getBlack(), new com.aspose.cells.b.a.b.zo(0.0F, 0.0F), var4.a, var4.b.isSuperscript(), var4.b.isSubscript());
      return (int)(var8.j().b() / 72.0F * c + 0.5F);
   }

   public static com.aspose.cells.b.a.b.zt a(String var0, Font var1, double[] var2) throws Exception {
      zot var3 = new zot();
      var3.a = var0;
      var3.b = var1;
      float var4 = Math.max(0.1F, (float)(var3.b.getDoubleSize() * var2[1]));
      int var5 = (var3.b.isBold() ? 1 : 0) | (var3.b.isItalic() ? 2 : 0) | (var3.b.isStrikeout() ? 8 : 0) | (var3.b.getUnderline() != 0 ? 4 : 0);
      com.aspose.cells.a.d.zav var6 = com.aspose.cells.a.d.zav.a(var3.b.getName(), var4, var5);
      com.aspose.cells.a.d.zf var7 = new com.aspose.cells.a.d.zf(var6, Color.getBlack(), new com.aspose.cells.b.a.b.zo(0.0F, 0.0F), var3.a, var3.b.isSuperscript(), var3.b.isSubscript());
      return var7.i();
   }

   private static Color a(String var0, Color var1) {
      if (var0 != null && var0.length() != 0) {
         var0 = var0.toLowerCase();
         if (var0.indexOf("[red]") >= 0) {
            return Color.getRed();
         } else {
            return var0.indexOf("[green]") >= 0 ? Color.getGreen() : var1;
         }
      } else {
         return var1;
      }
   }

   static Color a(double var0, String var2, Color var3) {
      String[] var4 = com.aspose.cells.b.a.zv.d(var2, new char[]{';'});
      if (var4.length >= 1) {
         if (var0 > 0.0D) {
            return a(var4[0], var3);
         }

         if (var0 < 0.0D && var4.length >= 2) {
            return a(var4[1], var3);
         }

         if (Math.abs(var0) < 1.0E-14D && var4.length >= 3) {
            return a(var4[2], var3);
         }
      }

      return var3;
   }

   static Color a(Style var0, Font var1, Cell var2) {
      if (var2 != null && var2.getType() == 4) {
         switch(var0.getNumber()) {
         case 0:
            String var3 = var0.getCustom();
            if (var3 != null && !"".equals(var3)) {
               return a(var2.getDoubleValue(), var0.getCustom(), var1.getColor());
            }

            return var1.getColor();
         case 6:
         case 8:
         case 38:
         case 40:
            return var2.getDoubleValue() < 0.0D ? Color.getRed() : var1.getColor();
         default:
            return var1.getColor();
         }
      } else {
         return var1.getColor();
      }
   }

   static Color a(Style var0) {
      return var0.getPattern() == 0 ? Color.getEmpty() : var0.getForegroundColor();
   }

   static int[] c(Worksheet var0) {
      Range[] var1 = var0.getPageSetup().b(true);
      int[] var2 = new int[]{-1, -1, -1, -1};
      if (var1 == null) {
         return var2;
      } else {
         if (var1[0] != null) {
            var2[0] = Math.min(var1[0].a().StartRow, var1[0].a().EndRow);
            var2[1] = Math.max(var1[0].a().StartRow, var1[0].a().EndRow);
         }

         if (var1[1] != null) {
            var2[2] = Math.min(var1[1].a().StartColumn, var1[1].a().EndColumn);
            var2[3] = Math.max(var1[1].a().StartColumn, var1[1].a().EndColumn);
         }

         return var2;
      }
   }

   static double a(int var0, Font var1, double var2) throws Exception {
      com.aspose.cells.a.d.zfq var4 = com.aspose.cells.a.d.zfs.b(var1.getName(), var1.m(), false);
      return (double)(var4.a(' ', (float)var1.getDoubleSize()) * 3.0F * (float)var0) * var2;
   }

   static double b(int var0, Font var1, double var2) throws Exception {
      com.aspose.cells.a.d.zfq var4 = com.aspose.cells.a.d.zfs.b(var1.getName(), var1.m(), false);
      float var5 = zgd.a(var1.getDoubleSize(), (float)var2);
      return (double)(var4.a(' ', var5) * 3.0F * (float)var0);
   }

   static com.aspose.cells.b.a.b.zt a(int var0, Font var1, double[] var2) throws Exception {
      com.aspose.cells.a.d.zfq var3 = com.aspose.cells.a.d.zfs.b(var1.getName(), var1.m(), false);
      float var4 = var3.c(com.aspose.cells.b.a.zo.a(var0) + " ", (float)var1.getDoubleSize()) * (float)var2[0];
      float var5 = var3.a((float)var1.getDoubleSize()) * (float)var2[1];
      return new com.aspose.cells.b.a.b.zt(var4, var5);
   }
}
